package com.nexgo.payment.constrant;

import com.nexgo.payment.R;

/**
 * 交易类型及相应信息枚举
 * Created by xiaox on 2017/1/27.
 */
public enum TransType {

    TRANS_TEST(R.string.trans_trans_test, 0, "0820", "", "", "00", false, false, false),

    UPLOAD_STATE(R.string.trans_upload_state, 0, "0820", "", "", "00", false, false, false),

    RF_PARAM_DOWN(R.string.trans_download_rf_parameter, 0, "0500", "500000", "", "00", false, false, false),

    QPS_BIN_B_DOWN(R.string.trans_download_free_password_card_bin_append, 0, "0800", "", "", "00", false, false, false),

    QPS_BIN_B_END(0, 0, "0800", "", "", "00", false, false, false),

    QPS_BIN_C_DOWN(R.string.trans_download_free_password_blacklist, 0, "0800", "", "", "00", false, false, false),

    QPS_BIN_C_END(0, 0, "0800", "", "", "00", false, false, false),

    LOGIN(R.string.trans_login, 0, "0820", "910000", "00", "", false, false, false),

    LOGOUT(R.string.trans_logout, 0, "0820", "", "", "00", false, false, false),

    CAPK_NOTIFY(0, 0, "0820", "", "", "00", false, false, false),

    CAPK_DOWN(R.string.trans_download_capk, 0, "0500", "200000", "", "00", false, false, false),

    CAPK_END(0, 0, "0800", "", "", "00", false, false, false),

    AID_NOTIFY(0, 0, "0820", "", "", "00", false, false, false),

    AID_DOWN(R.string.trans_download_aid, 0, "0500", "300000", "", "00", false, false, false),

    AID_END(0, 0, "0800", "", "", "00", false, false, false),

    PARAM_DOWN(R.string.trans_download_parameter, 0, "0800", "", "", "00", false, false, false),

    BLACKLIST_DOWN(R.string.trans_download_blacklist, 0, "0800", "", "", "00", false, false, false),

    BLACKLIST_END(0, 0, "0800", "", "", "00", false, false, false),

    SCRIPT_NOTIFY(0, 0, "0500", "100000", "", "00", false, false, false),

    REVERSAL(0, 0, "0400", "", "", "00", false, false, false),

    SALE(R.string.trans_sale, R.string.trans_sale_en, "0200", "000000", "00", "22", true, true, true),

    OFF_SALE(R.string.trans_sale, R.string.trans_sale_en, "0200", "000000", "00", "36", true, true, true),

//    SCAN_SALE(R.string.trans_sale_scan, R.string.trans_sale_scan_en, "0200", "000000", "00", "22", true, true, true),

    VOID(R.string.trans_sale_void, R.string.trans_sale_void_en, "0200", "200000", "00", "23", true, true, true),

//    SCAN_VOID(R.string.trans_sale_void_scan, R.string.trans_sale_void_scan_en, "0200", "200000", "00", "23", true, true, true),

    REFUND(R.string.trans_refund, R.string.trans_refund_en, "0220", "200000", "00", "25", true, false, true),

    ONLINE_REFUND(R.string.trans_refund, R.string.trans_refund_en, "0220", "200000", "60", "25", true, false, true),

    SCAN_REFUND(R.string.trans_refund_scan, R.string.trans_refund_scan_en, "0200", "170000", "00", "25", true, false, true),

    QUERY(R.string.trans_balance_query, 0, "0200", "300000", "00", "01", false, false, true),

    AUTH(R.string.trans_auth, R.string.trans_auth_en, "0100", "030000", "06", "10", true, true, true),

    AUTH_VOID(R.string.trans_auth_void, R.string.trans_auth_void_en, "0100", "200000", "06", "11", true, true, true),

    AUTH_CM(R.string.trans_auth_complete, R.string.trans_auth_complete_en, "0200", "000000", "06", "20", true, true, true),

    AUTH_CM_VOID(R.string.trans_auth_complete_void, R.string.trans_auth_complete_void_en, "0200", "200000", "06", "21", true, true, true),

    AUTH_CM_NOTIFY(R.string.trans_auth_complete_notify, R.string.trans_auth_complete_notify_en, "0220", "000000", "06", "24", true, false, true),

    EC_SALE(R.string.trans_ec_sale, R.string.trans_ec_sale_en, "0200", "000000", "00", "36", true, true, false),

    EC_LOG(R.string.trans_ec_log_query, 0, "0200", "000000", "00", "", false, false, false),

    EC_BALANCE(R.string.trans_ec_balance_query, 0, "0200", "000000", "00", "", false, false, false),

    SETTLE(R.string.trans_settle, 0, "0820", "920000", "00", "00", false, false, true),//lr

    UPLOAD_MAG_OFFLINE(0, 0, "0220", "", "", "", false, false, false),

    UPLOAD_ICC_OFFLINE(0, 0, "0320", "000000", "", "", false, false, false),

    UPLOAD_ES(0, 0, "0820", "", "", "07", false, false, false),

    BATCH_UPLOAD_ICC_OFFLINE(0, 0, "0320", "000000", "", "", false, false, false),

    BATCH_UPLOAD_ICC_ONLINE(0, 0, "0500", "000000", "", "", false, false, false),

    BATCH_UPLOAD_ICC_ONLINE_ARPC(0, 0, "0500", "400000", "", "", false, false, false),

    BATCH_UPLOAD_ICC_OFFLINE_DECLINED(0, 0, "0500", "400000", "", "", false, false, false),

    BATCH_UPLOAD_ICC_NOTIFY(0, 0, "0320", "", "", "", false, false, false),

    BATCH_UPLOAD_MAG_NOTIFY(0, 0, "0320", "", "", "", false, false, false),

    BATCH_UPLOAD_MAG_ONLINE(0, 0, "0320", "", "", "", false, false, false),

    BATCH_UPLOAD_MAG_OFFLINE(0, 0, "0320", "", "", "", false, false, false),

    BATCH_END(0, 0, "0320", "", "", "00", false, false, true),

    SCAN_SALE(R.string.trans_scan_pay, R.string.trans_scan_pay_en, "0200", "170000", "00", "22", true, false, true),

    SCAN_QUERY(R.string.trans_scan_query, R.string.trans_scan_query_en, "0200", "170000", "00", "22", true, false, true),

    SCAN_ORDER(R.string.trans_scan_order, R.string.trans_scan_order_en, "0200", "170000", "00", "22", true, false, true),

    SCAN_CANCEL(R.string.trans_scan_cancel, R.string.trans_scan_pay_en, "0200", "170000", "00", "22", true, false, false),

    SCAN_VOID(R.string.trans_sale_void, R.string.trans_scan_pay_en, "0200", "170000", "00", "22", true, false, false),

    GPSERR_NOTIFY(R.string.trans_warn_notify, 0, "", "", "", "", true, false, false),

    RESET_GPS(R.string.trans_reset_gps, 0, "", "", "", "", false, false, false),

    WORK_MASTER_KEY_DOWN(R.string.work_master_key_down, 0, "", "", "", "", false, false, false),

    RISKTRADE(R.string.risktrade, 0, "", "", "", "", false, false, false);

    /**
     * 交易中文名称
     */
    private final int name;
    /**
     * 交易英文名称
     */
    private final int enName;
    /**
     * 消息类型
     */
    private final String msgType;
    /**
     * 交易处理码3域
     */
    private final String procCode;
    /**
     * 服务点条件码25域
     */
    private final String conditionCode;
    /**
     * 消息类型码60.1域
     */
    private final String funcCode;
    /**
     * 交易是否存数据库
     */
    private boolean saveRecord;
    /**
     * 交易异常时是否需要冲正
     */
    private boolean reversal;
    /**
     * 交易发送前是否需要发提前包（脚本上送，冲正，电子签名等等）
     */
    private boolean preSend;

    TransType(int name, int enName, String msgType, String procCode, String conditionCode, String funcCode, boolean saveRecord, boolean reversal, boolean preSend) {
        this.name = name;
        this.enName = enName;
        this.msgType = msgType;
        this.procCode = procCode;
        this.conditionCode = conditionCode;
        this.funcCode = funcCode;
        this.saveRecord = saveRecord;
        this.reversal = reversal;
        this.preSend = preSend;
    }

    public String getMsgType() {
        return msgType;
    }

    public String getProcCode() {
        return procCode;
    }

    public String getFuncCode() {
        return funcCode;
    }

    public int getName() {
        return name;
    }

    public int getEnName() {
        return enName;
    }

    public boolean isSaveRecord() {
        return saveRecord;
    }

    public boolean isPreSend() {
        return preSend;
    }

    public boolean isReversal() {
        return reversal;
    }

    public String getConditionCode() {
        return conditionCode;
    }
}
